var _tools = require("../../../utils/tools.js"), _tools2 = _interopRequireDefault(_tools);

function _interopRequireDefault(t) {
    return t && t.__esModule ? t : {
        default: t
    };
}

function _defineProperty(t, e, a) {
    return e in t ? Object.defineProperty(t, e, {
        value: a,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : t[e] = a, t;
}

var that, app = getApp();

Page({
    data: {
        p: 1,
        orderStatus: _defineProperty({
            1: "FA2828",
            2: "FF8E00",
            3: "26BCC5",
            4: "909090"
        }, "4", "8C9EAE"),
        share_text: "",
        share_image: "",
        isShowPop: !1,
        order_explain: "",
        service_image: ""
    },
    onLoad: function(t) {
        that = this;
    },
    onReady: function() {
        var t = {
            action: "order",
            contr: "sign",
            token: wx.getStorageSync("token")
        };
        _tools2.default.request(t, function(t) {
            that.setData(t.info);
        }), wx.setNavigationBarColor({
            frontColor: "#000000",
            backgroundColor: "#000000"
        });
    },
    goToPdd: function(t) {
        var e = t.currentTarget.dataset.goodsid, a = {
            action: "generate",
            contr: "pdd",
            token: wx.getStorageSync("token"),
            goods_id: e
        };
        _tools2.default.request(a, function(t) {
            wx.navigateToMiniProgram({
                appId: t.info.we_app_info.app_id,
                path: t.info.we_app_info.page_path,
                success: function(t) {},
                fail: function() {},
                complete: function() {}
            });
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        return {
            title: this.data.share.text,
            imageUrl: this.data.share.images,
            path: "bh_bargain/pages/index/index?parent_id=" + this.data.share.member_id
        };
    },
    navigateToDetial: function(t) {
        var e = t.currentTarget.dataset.index;
        2 != this.data.orders[e].type ? wx.navigateTo({
            url: "/bh_bargain/pages/integral_goods/integral_goods?id=" + this.data.orders[e].goods_id
        }) : wx.navigateTo({
            url: "/bh_bargain/pages/pdd_details/pdd_details?id=" + this.data.orders[e].goods_id + "&pdd_id=" + this.data.orders[e].relation_goods_id
        });
    },
    nagativeToIndex: function() {
        wx.navigateTo({
            url: "/bh_bargain/pages/signIn/signIn"
        });
    },
    copy: function(t) {
        var e = t.currentTarget.dataset.value;
        wx.setClipboardData({
            data: e,
            success: function(t) {
                wx.showToast({
                    title: "复制成功"
                }), o.sensors.track("XMClick", {
                    ck_module: "复制运单号",
                    contentid: "",
                    page: "订单页面"
                });
            }
        });
    }
});